﻿Imports System.Drawing.Drawing2D
Imports System.Drawing.Text
Public Class RoseControl
    Public m_SettingPannel As Pannel '当前绘图类
    Property SettingPannel() As Pannel
        Get
            Return m_SettingPannel
        End Get
        Set(ByVal value As Pannel)
            m_SettingPannel = value
        End Set
    End Property

    Private m_CheckData As Boolean = False '判断是否已经导入了数据
    ''' <summary>
    ''' 判断是否已经导入了数据
    ''' </summary>
    ''' <value></value>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Property CheckData() As Boolean
        Get
            Return m_CheckData
        End Get
        Set(ByVal value As Boolean)
            m_CheckData = value
        End Set
    End Property

    '设置玫瑰图的风向标注的字体
    Private Sub TitleSetFont_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TitleSetFont.Click
        Dim fontDlg As New FontDialog
        If Not m_SettingPannel Is Nothing Then
            If m_SettingPannel.Circles.ArrayCircles IsNot Nothing AndAlso m_SettingPannel.Circles.ArrayCircles.Length > 0 Then
                fontDlg.Font = m_SettingPannel.Circles.ArrayCircles(0).CircleAxesTitle.TitleFont
                If fontDlg.ShowDialog() = Windows.Forms.DialogResult.OK Then '如果用户点击确定，则将线形编程器的画笔给当前画笔
                    For i As Integer = 0 To m_SettingPannel.Circles.ArrayCircles.Length - 1
                        m_SettingPannel.Circles.ArrayCircles(i).CircleAxesTitle.TitleFont = fontDlg.Font
                    Next
                End If
            End If
        End If
        Me.ParentForm.Refresh()
    End Sub
    '玫瑰图的风向标注的字体示例
    Private Sub picLegend_Paint(ByVal sender As System.Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles picLegend.Paint
        Dim mycolor As Color = Color.Black
        Dim fontFamily As New FontFamily(New GenericFontFamilies)
        Dim myfont As Font = New Font(fontFamily, 10, FontStyle.Regular, GraphicsUnit.Pixel)
        If Not m_SettingPannel Is Nothing Then
            If m_SettingPannel.Circles.ArrayCircles IsNot Nothing AndAlso m_SettingPannel.Circles.ArrayCircles.Length - 1 > 0 Then
                mycolor = Color.FromArgb(m_SettingPannel.Circles.ArrayCircles(0).CircleAxesTitle.TitleColor)
                myfont = m_SettingPannel.Circles.ArrayCircles(0).CircleAxesTitle.TitleFont
            End If
        End If
        Dim mybrush As New SolidBrush(mycolor)
        e.Graphics.DrawString("示例", myfont, mybrush, 5, 5)
    End Sub

    Private Sub TitleSetColor_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TitleSetColor.Click
        '设置玫瑰图的标题的字体颜色
        Dim colorDlg As New ColorDialog
        If Not m_SettingPannel Is Nothing Then
            If m_SettingPannel.Circles.ArrayCircles IsNot Nothing AndAlso m_SettingPannel.Circles.ArrayCircles.Length > 0 Then
                colorDlg.Color = Color.FromArgb(m_SettingPannel.Circles.ArrayCircles(0).CircleAxesTitle.TitleColor)
                If colorDlg.ShowDialog() = Windows.Forms.DialogResult.OK Then
                    For i As Integer = 0 To m_SettingPannel.Circles.ArrayCircles.Length - 1
                        m_SettingPannel.Circles.ArrayCircles(i).CircleAxesTitle.TitleColor = colorDlg.Color.ToArgb
                    Next
                End If
            End If
        End If
        Me.ParentForm.Refresh()
    End Sub
    '风向标注
    Private Sub TitleSetColor_Paint(ByVal sender As System.Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles TitleSetColor.Paint
        Dim mycolor As Color
        If Not m_SettingPannel Is Nothing Then
            If m_SettingPannel.Circles.ArrayCircles IsNot Nothing AndAlso m_SettingPannel.Circles.ArrayCircles.Length > 0 Then
                mycolor = Color.FromArgb(m_SettingPannel.Circles.ArrayCircles(0).CircleAxesTitle.TitleColor)
            End If
        End If
        Dim rect As New Rectangle(5, 5, 30, TitleSetColor.Height - 10)
        Dim LineBrush As New SolidBrush(mycolor)
        e.Graphics.FillRectangle(LineBrush, rect)
        e.Graphics.DrawRectangle(Pens.Black, rect)
    End Sub
    '圆圈线的设置
    Private Sub SetCircleLines_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SetCircleLines.Click
        'If m_CheckData Then
        If Not m_SettingPannel Is Nothing Then
            If m_SettingPannel.Circles.ArrayCircles IsNot Nothing AndAlso m_SettingPannel.Circles.ArrayCircles.Length > 0 Then
                Dim frmLineStyle As New LineStyleEditor
                '分别赋给属性值，进行值传递，并调整宽度比例
                frmLineStyle.penCurLineStyle.DashStyle = m_SettingPannel.Circles.ArrayCircles(0).CircleAxes.PenProperty.DashStyle '画笔的样式
                frmLineStyle.penCurLineStyle.Width = m_SettingPannel.Circles.ArrayCircles(0).CircleAxes.PenProperty.Width / PannelSetting.gScale
                frmLineStyle.penCurLineStyle.Color = Color.FromArgb(m_SettingPannel.Circles.ArrayCircles(0).CircleAxes.PenProperty.color)
                If frmLineStyle.ShowDialog() = Windows.Forms.DialogResult.OK Then '如果用户点击确定，则将线形编程器的画笔给当前画笔
                    For i As Integer = 0 To m_SettingPannel.Circles.ArrayCircles.Length - 1
                        m_SettingPannel.Circles.ArrayCircles(i).CircleAxes.PenProperty.DashStyle = frmLineStyle.penCurLineStyle.DashStyle
                        m_SettingPannel.Circles.ArrayCircles(i).CircleAxes.PenProperty.Width = frmLineStyle.penCurLineStyle.Width * PannelSetting.gScale
                        m_SettingPannel.Circles.ArrayCircles(i).CircleAxes.PenProperty.color = frmLineStyle.penCurLineStyle.Color.ToArgb
                    Next
                End If
            End If
        End If
        'End If
        Me.ParentForm.Refresh()
    End Sub

    '圆圈线是否可见
    Private Sub CricleLineVisible_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CricleLineVisible.CheckedChanged
        '设置玫瑰图的标题的字体
        If Not m_SettingPannel Is Nothing Then
            If m_SettingPannel.Circles.ArrayCircles IsNot Nothing AndAlso m_SettingPannel.Circles.ArrayCircles.Length > 0 Then
                For i As Integer = 0 To m_SettingPannel.Circles.ArrayCircles.Length - 1
                    m_SettingPannel.Circles.ArrayCircles(i).CircleAxes.Visible = CricleLineVisible.Checked
                Next
            End If
        End If
        If Me.ParentForm IsNot Nothing Then
            Me.ParentForm.Refresh()
        End If
    End Sub
    '圈圈线图例
    Private Sub PicCircleLines_Paint(ByVal sender As System.Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles PicCircleLines.Paint
        'If CheckData Then
        If Not m_SettingPannel Is Nothing Then
            '根据当前选中的边轴确定是否绘图该座标线
            If m_SettingPannel.Circles.ArrayCircles IsNot Nothing AndAlso m_SettingPannel.Circles.ArrayCircles.Length > 0 Then
                Dim myMatrix As New Matrix()
                myMatrix.Scale(1 / PannelSetting.gScale, 1 / PannelSetting.gScale) '调整比例
                e.Graphics.Transform = myMatrix

                Dim ContourLinePen As New Pen(Color.FromArgb(m_SettingPannel.Circles.ArrayCircles(0).CircleAxes.PenProperty.color))
                ContourLinePen.Width = m_SettingPannel.Circles.ArrayCircles(0).CircleAxes.PenProperty.Width
                ContourLinePen.DashStyle = m_SettingPannel.Circles.ArrayCircles(0).CircleAxes.PenProperty.DashStyle
                e.Graphics.DrawLine(ContourLinePen, 0, CInt(e.ClipRectangle.Height / 2 * PannelSetting.gScale), CInt(e.ClipRectangle.Width * PannelSetting.gScale), CInt(e.ClipRectangle.Height / 2 * PannelSetting.gScale))
            End If
        End If
        'End If
    End Sub
    '坐标轴可见
    Private Sub AixsLineVisible_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles AixsLineVisible.CheckedChanged
        If Not m_SettingPannel Is Nothing Then
            If m_SettingPannel.Circles.ArrayCircles IsNot Nothing AndAlso m_SettingPannel.Circles.ArrayCircles.Length > 0 Then
                For i As Integer = 0 To m_SettingPannel.Circles.ArrayCircles.Length - 1
                    m_SettingPannel.Circles.ArrayCircles(i).CircleGrids.Visible = AixsLineVisible.Checked
                Next
            End If
        End If
        If Me.ParentForm IsNot Nothing Then
            Me.ParentForm.Refresh()
        End If
    End Sub
    '坐标线线型设置
    Private Sub SetAxisLines_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SetAxisLines.Click
        'If CheckData Then
        Dim frmLineStyle As New LineStyleEditor
        If Not m_SettingPannel Is Nothing Then
            If m_SettingPannel.Circles.ArrayCircles IsNot Nothing AndAlso m_SettingPannel.Circles.ArrayCircles.Length > 0 Then
                '分别赋给属性值，进行值传递，并调整宽度比例
                frmLineStyle.penCurLineStyle.DashStyle = m_SettingPannel.Circles.ArrayCircles(0).CircleGrids.PenProperty.DashStyle '画笔的样式
                frmLineStyle.penCurLineStyle.Width = m_SettingPannel.Circles.ArrayCircles(0).CircleGrids.PenProperty.Width / PannelSetting.gScale
                frmLineStyle.penCurLineStyle.Color = Color.FromArgb(m_SettingPannel.Circles.ArrayCircles(0).CircleGrids.PenProperty.color)
                If frmLineStyle.ShowDialog() = Windows.Forms.DialogResult.OK Then '如果用户点击确定，则将线形编程器的画笔给当前画笔
                    For i As Integer = 0 To m_SettingPannel.Circles.ArrayCircles.Length - 1
                        m_SettingPannel.Circles.ArrayCircles(i).CircleGrids.PenProperty.DashStyle = frmLineStyle.penCurLineStyle.DashStyle
                        m_SettingPannel.Circles.ArrayCircles(i).CircleGrids.PenProperty.Width = frmLineStyle.penCurLineStyle.Width * PannelSetting.gScale
                        m_SettingPannel.Circles.ArrayCircles(i).CircleGrids.PenProperty.color = frmLineStyle.penCurLineStyle.Color.ToArgb
                    Next
                End If
            End If
        End If
        'End If
        Me.ParentForm.Refresh()
    End Sub
    '坐标轴图例
    Private Sub PicAxisLines_Paint(ByVal sender As System.Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles PicAxisLines.Paint
        'If CheckData Then
        If Not m_SettingPannel Is Nothing Then
            '根据当前选中的边轴确定是否绘图该座标线
            If m_SettingPannel.Circles.ArrayCircles IsNot Nothing AndAlso m_SettingPannel.Circles.ArrayCircles.Length > 0 Then
                Dim myMatrix As New Matrix()
                myMatrix.Scale(1 / PannelSetting.gScale, 1 / PannelSetting.gScale) '调整比例
                e.Graphics.Transform = myMatrix
                Dim ContourLinePen As New Pen(Color.FromArgb(m_SettingPannel.Circles.ArrayCircles(0).CircleGrids.PenProperty.color))
                ContourLinePen.Width = m_SettingPannel.Circles.ArrayCircles(0).CircleGrids.PenProperty.Width
                ContourLinePen.DashStyle = m_SettingPannel.Circles.ArrayCircles(0).CircleGrids.PenProperty.DashStyle
                e.Graphics.DrawLine(ContourLinePen, 0, CInt(e.ClipRectangle.Height / 2 * PannelSetting.gScale), CInt(e.ClipRectangle.Width * PannelSetting.gScale), CInt(e.ClipRectangle.Height / 2 * PannelSetting.gScale))
            End If
        End If
        'End If
    End Sub

    '玫瑰图的填充一
    Private Sub SetRoseChartColorO_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SetRoseChartColorO.Click
        Dim colorDlg As New ColorDialog
        If Not m_SettingPannel Is Nothing Then
            If m_SettingPannel.Circles.ArrayCircles IsNot Nothing AndAlso m_SettingPannel.Circles.ArrayCircles.Length > 0 Then
                colorDlg.Color = m_SettingPannel.Circles.ArrayCircles(0).RoseLine.m_SolidBrush1.Color
                If colorDlg.ShowDialog() = Windows.Forms.DialogResult.OK Then
                    For i As Integer = 0 To m_SettingPannel.Circles.ArrayCircles.Length - 1
                        m_SettingPannel.Circles.ArrayCircles(i).RoseLine.m_SolidBrush1.Color = colorDlg.Color
                    Next
                End If
            End If
        End If
        Me.ParentForm.Refresh()
    End Sub
    '玫瑰图的填充二
    Private Sub SetRoseChartColorT_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SetRoseChartColorT.Click
        Dim colorDlg As New ColorDialog
        If Not m_SettingPannel Is Nothing Then
            If m_SettingPannel.Circles.ArrayCircles IsNot Nothing AndAlso m_SettingPannel.Circles.ArrayCircles.Length > 0 Then
                colorDlg.Color = m_SettingPannel.Circles.ArrayCircles(0).RoseLine.m_SolidBrush2.Color
                If colorDlg.ShowDialog() = Windows.Forms.DialogResult.OK Then
                    For i As Integer = 0 To m_SettingPannel.Circles.ArrayCircles.Length - 1
                        m_SettingPannel.Circles.ArrayCircles(i).RoseLine.m_SolidBrush2.Color = colorDlg.Color
                    Next
                End If
            End If
        End If
        Me.ParentForm.Refresh()
    End Sub

    '示例色一
    Private Sub SetRoseChartColorO_Paint(ByVal sender As System.Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles SetRoseChartColorO.Paint
        Dim mycolor As Color
        If Not m_SettingPannel Is Nothing Then
            If m_SettingPannel.Circles.ArrayCircles IsNot Nothing AndAlso m_SettingPannel.Circles.ArrayCircles.Length > 0 Then
                mycolor = m_SettingPannel.Circles.ArrayCircles(0).RoseLine.m_SolidBrush1.Color
            End If
        End If
        Dim rect As New Rectangle(5, 5, 20, TitleSetColor.Height - 10)
        Dim LineBrush As New SolidBrush(mycolor)
        e.Graphics.FillRectangle(LineBrush, rect)
        e.Graphics.DrawRectangle(Pens.Black, rect)
    End Sub
    '示例色二
    Private Sub SetRoseChartColorT_Paint(ByVal sender As System.Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles SetRoseChartColorT.Paint
        Dim mycolor As Color
        If Not m_SettingPannel Is Nothing Then
            If m_SettingPannel.Circles.ArrayCircles IsNot Nothing AndAlso m_SettingPannel.Circles.ArrayCircles.Length > 0 Then
                mycolor = m_SettingPannel.Circles.ArrayCircles(0).RoseLine.m_SolidBrush2.Color
            End If
        End If
        Dim rect As New Rectangle(5, 5, 20, TitleSetColor.Height - 10)
        Dim LineBrush As New SolidBrush(mycolor)
        e.Graphics.FillRectangle(LineBrush, rect)
        e.Graphics.DrawRectangle(Pens.Black, rect)
    End Sub

    '玫瑰名称字体
    Private Sub SetRoseName_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SetRoseName.Click
        Dim fontDlg As New FontDialog
        If Not m_SettingPannel Is Nothing Then
            If m_SettingPannel.Circles.ArrayCircles IsNot Nothing AndAlso m_SettingPannel.Circles.ArrayCircles.Length > 0 Then
                fontDlg.Font = m_SettingPannel.Circles.ArrayCircles(0).BottomTitle.TitleFont
                If fontDlg.ShowDialog() = Windows.Forms.DialogResult.OK Then '如果用户点击确定，则将线形编程器的画笔给当前画笔
                    For i As Integer = 0 To m_SettingPannel.Circles.ArrayCircles.Length - 1
                        m_SettingPannel.Circles.ArrayCircles(i).BottomTitle.TitleFont = fontDlg.Font
                    Next
                End If
            End If
        End If
        Me.ParentForm.Refresh()
    End Sub

    '设置玫瑰图的名称的字体颜色
    Private Sub SetRoseNameColor_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SetRoseNameColor.Click
        Dim colorDlg As New ColorDialog
        If Not m_SettingPannel Is Nothing Then
            If m_SettingPannel.Circles.ArrayCircles IsNot Nothing AndAlso m_SettingPannel.Circles.ArrayCircles.Length > 0 Then
                colorDlg.Color = Color.FromArgb(m_SettingPannel.Circles.ArrayCircles(0).BottomTitle.PenProperty.color)
                If colorDlg.ShowDialog() = Windows.Forms.DialogResult.OK Then
                    For i As Integer = 0 To m_SettingPannel.Circles.ArrayCircles.Length - 1
                        m_SettingPannel.Circles.ArrayCircles(i).BottomTitle.PenProperty.color = colorDlg.Color.ToArgb
                    Next
                End If
            End If
        End If
        Me.ParentForm.Refresh()
    End Sub

    '名称图例
    Private Sub PicSetRoseName_Paint(ByVal sender As System.Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles PicSetRoseName.Paint
        Dim mycolor As Color = Color.Black
        Dim fontFamily As New FontFamily(New GenericFontFamilies)
        Dim myfont As Font = New Font(fontFamily, 10, FontStyle.Regular, GraphicsUnit.Pixel)
        If Not m_SettingPannel Is Nothing Then
            If m_SettingPannel.Circles.ArrayCircles IsNot Nothing AndAlso m_SettingPannel.Circles.ArrayCircles.Length - 1 > 0 Then
                mycolor = Color.FromArgb(m_SettingPannel.Circles.ArrayCircles(0).BottomTitle.PenProperty.color)
                myfont = m_SettingPannel.Circles.ArrayCircles(0).BottomTitle.TitleFont
            End If
        End If
        Dim mybrush As New SolidBrush(mycolor)
        e.Graphics.DrawString("示例", myfont, mybrush, 5, 5)
    End Sub

    Private Sub SetRoseNameColor_Paint(ByVal sender As System.Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles SetRoseNameColor.Paint
        Dim mycolor As Color
        If Not m_SettingPannel Is Nothing Then
            If m_SettingPannel.Circles.ArrayCircles IsNot Nothing AndAlso m_SettingPannel.Circles.ArrayCircles.Length > 0 Then
                mycolor = Color.FromArgb(m_SettingPannel.Circles.ArrayCircles(0).BottomTitle.PenProperty.color)
            End If
        End If
        Dim rect As New Rectangle(5, 5, 30, TitleSetColor.Height - 10)
        Dim LineBrush As New SolidBrush(mycolor)
        e.Graphics.FillRectangle(LineBrush, rect)
        e.Graphics.DrawRectangle(Pens.Black, rect)
    End Sub
    '玫瑰图案是否可见
    Private Sub RoseChartVisible_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RoseChartVisible.CheckedChanged
        If Not m_SettingPannel Is Nothing Then
            If m_SettingPannel.Circles.ArrayCircles IsNot Nothing AndAlso m_SettingPannel.Circles.ArrayCircles.Length > 0 Then
                For i As Integer = 0 To m_SettingPannel.Circles.ArrayCircles.Length - 1
                    m_SettingPannel.Circles.ArrayCircles(i).RoseLine.Visible = RoseChartVisible.Checked
                Next
            End If
        End If
        If Me.ParentForm IsNot Nothing Then
            Me.ParentForm.Refresh()
        End If
    End Sub
    '玫瑰图线是否可见
    Private Sub RoseLineVisible_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RoseLineVisible.CheckedChanged
        If Not m_SettingPannel Is Nothing Then
            If m_SettingPannel.Circles.ArrayCircles IsNot Nothing AndAlso m_SettingPannel.Circles.ArrayCircles.Length > 0 Then
                For i As Integer = 0 To m_SettingPannel.Circles.ArrayCircles.Length - 1
                    m_SettingPannel.Circles.ArrayCircles(i).RoseLine.VisibleRoseLine = RoseLineVisible.Checked
                Next
            End If
        End If
        If Me.ParentForm IsNot Nothing Then
            Me.ParentForm.Refresh()
        End If
    End Sub
    '玫瑰图线的线型
    Private Sub SetRoseLine_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SetRoseLine.Click
        'If CheckData Then
        Dim frmLineStyle As New LineStyleEditor
        If Not m_SettingPannel Is Nothing Then
            If m_SettingPannel.Circles.ArrayCircles IsNot Nothing AndAlso m_SettingPannel.Circles.ArrayCircles.Length > 0 Then
                '分别赋给属性值，进行值传递，并调整宽度比例
                frmLineStyle.penCurLineStyle.DashStyle = m_SettingPannel.Circles.ArrayCircles(0).RoseLine.PenProperty.DashStyle '画笔的样式
                frmLineStyle.penCurLineStyle.Width = m_SettingPannel.Circles.ArrayCircles(0).RoseLine.PenProperty.Width / PannelSetting.gScale
                frmLineStyle.penCurLineStyle.Color = Color.FromArgb(m_SettingPannel.Circles.ArrayCircles(0).RoseLine.PenProperty.color)
                If frmLineStyle.ShowDialog() = Windows.Forms.DialogResult.OK Then '如果用户点击确定，则将线形编程器的画笔给当前画笔
                    For i As Integer = 0 To m_SettingPannel.Circles.ArrayCircles.Length - 1
                        m_SettingPannel.Circles.ArrayCircles(i).RoseLine.PenProperty.DashStyle = frmLineStyle.penCurLineStyle.DashStyle
                        m_SettingPannel.Circles.ArrayCircles(i).RoseLine.PenProperty.Width = frmLineStyle.penCurLineStyle.Width * PannelSetting.gScale
                        m_SettingPannel.Circles.ArrayCircles(i).RoseLine.PenProperty.color = frmLineStyle.penCurLineStyle.Color.ToArgb
                    Next
                End If
            End If
        End If
        'End If
        Me.ParentForm.Refresh()
    End Sub

    Private Sub PicSetRoseLine_Paint(ByVal sender As System.Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles PicSetRoseLine.Paint
        'If CheckData Then
        If Not m_SettingPannel Is Nothing Then
            '根据当前选中的边轴确定是否绘图该座标线
            If m_SettingPannel.Circles.ArrayCircles IsNot Nothing AndAlso m_SettingPannel.Circles.ArrayCircles.Length > 0 Then
                Dim myMatrix As New Matrix()
                myMatrix.Scale(1 / PannelSetting.gScale, 1 / PannelSetting.gScale) '调整比例
                e.Graphics.Transform = myMatrix
                Dim ContourLinePen As New Pen(Color.FromArgb(m_SettingPannel.Circles.ArrayCircles(0).RoseLine.PenProperty.color))
                ContourLinePen.Width = m_SettingPannel.Circles.ArrayCircles(0).RoseLine.PenProperty.Width
                ContourLinePen.DashStyle = SettingPannel.Circles.ArrayCircles(0).RoseLine.PenProperty.DashStyle
                e.Graphics.DrawLine(ContourLinePen, 0, CInt(e.ClipRectangle.Height / 2 * PannelSetting.gScale), CInt(e.ClipRectangle.Width * PannelSetting.gScale), CInt(e.ClipRectangle.Height / 2 * PannelSetting.gScale))
            End If
        End If
        'End If
    End Sub

    '风向标注名称可见
    Private Sub TitleVisible_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TitleVisible.CheckedChanged
        If Not m_SettingPannel Is Nothing Then
            If m_SettingPannel.Circles.ArrayCircles IsNot Nothing AndAlso m_SettingPannel.Circles.ArrayCircles.Length > 0 Then
                For i As Integer = 0 To m_SettingPannel.Circles.ArrayCircles.Length - 1
                    m_SettingPannel.Circles.ArrayCircles(i).CircleAxesTitle.Visible = TitleVisible.Checked
                Next
            End If
        End If
        If Me.ParentForm IsNot Nothing Then
            Me.ParentForm.Refresh()
        End If
    End Sub
    '玫瑰名称可见
    Private Sub RoseNameVisible_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RoseNameVisible.CheckedChanged
        If Not m_SettingPannel Is Nothing Then
            If m_SettingPannel.Circles.ArrayCircles IsNot Nothing AndAlso m_SettingPannel.Circles.ArrayCircles.Length > 0 Then
                For i As Integer = 0 To m_SettingPannel.Circles.ArrayCircles.Length - 1
                    m_SettingPannel.Circles.ArrayCircles(i).BottomTitle.Visible = RoseNameVisible.Checked
                Next
            End If
        End If
        If Me.ParentForm IsNot Nothing Then
            Me.ParentForm.Refresh()
        End If
    End Sub

    '玫瑰刻度可见
    Private Sub DataVisible_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DataVisible.CheckedChanged
        If Not m_SettingPannel Is Nothing Then
            If m_SettingPannel.Circles.ArrayCircles IsNot Nothing AndAlso m_SettingPannel.Circles.ArrayCircles.Length > 0 Then
                For i As Integer = 0 To m_SettingPannel.Circles.ArrayCircles.Length - 1
                    m_SettingPannel.Circles.ArrayCircles(i).CircleLable.Visible = DataVisible.Checked
                Next
            End If
        End If
        If Me.ParentForm IsNot Nothing Then
            Me.ParentForm.Refresh()
        End If
    End Sub
    ' 玫瑰刻度字体
    Private Sub SetDataChar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SetDataChar.Click
        Dim fontDlg As New FontDialog
        If Not m_SettingPannel Is Nothing Then
            If m_SettingPannel.Circles.ArrayCircles IsNot Nothing AndAlso m_SettingPannel.Circles.ArrayCircles.Length > 0 Then
                fontDlg.Font = m_SettingPannel.Circles.ArrayCircles(0).CircleLable.LabelFont
                If fontDlg.ShowDialog() = Windows.Forms.DialogResult.OK Then '如果用户点击确定，则将线形编程器的画笔给当前画笔
                    For i As Integer = 0 To m_SettingPannel.Circles.ArrayCircles.Length - 1
                        m_SettingPannel.Circles.ArrayCircles(i).CircleLable.LabelFont = fontDlg.Font
                    Next
                End If
            End If
        End If
        Me.ParentForm.Refresh()
    End Sub
    ' 玫瑰刻度颜色
    Private Sub SetDataColor_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SetDataColor.Click
        '设置玫瑰图的标题的字体颜色
        Dim colorDlg As New ColorDialog
        If Not m_SettingPannel Is Nothing Then
            If m_SettingPannel.Circles.ArrayCircles IsNot Nothing AndAlso m_SettingPannel.Circles.ArrayCircles.Length > 0 Then
                colorDlg.Color = m_SettingPannel.Circles.ArrayCircles(0).CircleLable.LabelColor
                If colorDlg.ShowDialog() = Windows.Forms.DialogResult.OK Then
                    For i As Integer = 0 To m_SettingPannel.Circles.ArrayCircles.Length - 1
                        m_SettingPannel.Circles.ArrayCircles(i).CircleLable.LabelColor = colorDlg.Color
                    Next
                End If
            End If
        End If
        Me.ParentForm.Refresh()
    End Sub
    '玫瑰刻度示例
    Private Sub PicData_Paint(ByVal sender As System.Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles PicData.Paint
        Dim mycolor As Color = Color.Black
        Dim fontFamily As New FontFamily(New GenericFontFamilies)
        Dim myfont As Font = New Font(fontFamily, 10, FontStyle.Regular, GraphicsUnit.Pixel)
        If Not m_SettingPannel Is Nothing Then
            If m_SettingPannel.Circles.ArrayCircles IsNot Nothing AndAlso m_SettingPannel.Circles.ArrayCircles.Length - 1 > 0 Then
                mycolor = m_SettingPannel.Circles.ArrayCircles(0).CircleLable.LabelColor
                myfont = m_SettingPannel.Circles.ArrayCircles(0).CircleLable.LabelFont
            End If
        End If
        Dim mybrush As New SolidBrush(mycolor)
        e.Graphics.DrawString("示例", myfont, mybrush, 5, 5)
    End Sub
    '玫瑰刻度示例
    Private Sub SetDataColor_Paint(ByVal sender As System.Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles SetDataColor.Paint
        Dim mycolor As Color
        If Not m_SettingPannel Is Nothing Then
            If m_SettingPannel.Circles.ArrayCircles IsNot Nothing AndAlso m_SettingPannel.Circles.ArrayCircles.Length > 0 Then
                mycolor = m_SettingPannel.Circles.ArrayCircles(0).CircleLable.LabelColor
            End If
        End If
        Dim rect As New Rectangle(5, 5, 30, TitleSetColor.Height - 10)
        Dim LineBrush As New SolidBrush(mycolor)
        e.Graphics.FillRectangle(LineBrush, rect)
        e.Graphics.DrawRectangle(Pens.Black, rect)
    End Sub

    Private Sub RoseControl_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

    End Sub
End Class
